From 91e82e7e9e6b6b4fe0202c1f3946d2705f5ea0dc Mon Sep 17 00:00:00 2001 From: Richard Hult Date: Sun, 4 May 2008 15:15:00 +0000 Subject: [PATCH] Check if gdk_unicode_to_keyval() worked before using the result. Makes 2008-05-04 Richard Hult * gdk/quartz/gdkkeys-quartz.c (maybe_update_keymap): Check if gdk_unicode_to_keyval() worked before using the result. Makes function keys work, bug #530156. Also add F16 to the function key map. svn path=/trunk/; revision=20071 --- ChangeLog | 7 +++++++ gdk/quartz/gdkkeys-quartz.c | 23 ++++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1ae7aa8bb8..f258e95d52 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-05-04 Richard Hult + + * gdk/quartz/gdkkeys-quartz.c (maybe_update_keymap): Check if + gdk_unicode_to_keyval() worked before using the result. Makes + function keys work, bug #530156. Also add F16 to the function key + map. + 2008-05-04 Richard Hult * gdk/quartz/gdkkeys-quartz.c (maybe_update_keymap): Remove stray diff --git a/gdk/quartz/gdkkeys-quartz.c b/gdk/quartz/gdkkeys-quartz.c index 7cfd2e0dd7..e9db7e4c9a 100644 --- a/gdk/quartz/gdkkeys-quartz.c +++ b/gdk/quartz/gdkkeys-quartz.c @@ -128,7 +128,8 @@ const static struct { { 111, GDK_F12, 0 }, { 105, GDK_F13, 0 }, { 107, GDK_F14, 0 }, - { 113, GDK_F15, 0 } + { 113, GDK_F15, 0 }, + { 106, GDK_F16, 0 } }; const static struct { @@ -255,7 +256,15 @@ maybe_update_keymap (void) p[j] = GDK_ISO_Left_Tab; if (!found) - p[j] = gdk_unicode_to_keyval (uc); + { + guint tmp; + + tmp = gdk_unicode_to_keyval (uc); + if (tmp != (uc | 0x01000000)) + p[j] = tmp; + else + p[j] = 0; + } } } @@ -330,7 +339,15 @@ maybe_update_keymap (void) p[j] = GDK_ISO_Left_Tab; if (!found) - p[j] = gdk_unicode_to_keyval (uc); + { + guint tmp; + + tmp = gdk_unicode_to_keyval (uc); + if (tmp != (uc | 0x01000000)) + p[j] = tmp; + else + p[j] = 0; + } } } -- 2.30.2